def delete_function():
    while select==3:
        if not todo_list:
            print("Your todo list is empty! ")
            return todo_list
        
#show users the todo list
        print("\nCurrent todo list: ")
        for i,item in enumerate(todo_list,1):
            print(f"{i}.{item}")

#let users choose spmething to delete
        try:
            choice=int(input("Which part of your todo list you want to delete(please enter an integer): "))
            if 1<= choice <len(todo_list):
                deleted_items=todo_list.pop(choice)
                print(f"{deleted_items} has been deleted. ")
            else:
                print("The number is invalid. ")
        except ValueError:
            print("Please enter an integer. ")

        select=input("Do you want to continue deleting your todo list? (y/n)")
        return todo_list